#!/usr/bin/env python
#coding=utf-8
#这种方式在文件很大时不适合，占用内存空间很大

import csv

def readcsv(filename):
    return csv.reader(open(filename,'rb'),delimiter=',',quotechar='|')

def main():
    file1=r'c:/temp/csv1.csv'
    file2=r'c:/temp/csv2.csv'
    
    d1data=[x for x in readcsv(file1)]
    d2data=[x for x in readcsv(file2)]
    
    for d1it in d1data:
        print 'd1it:',d1it
        for d2it in d2data:            
            print 'd2it:',d2it
    return 0
    
if __name__ == '__main__':
    main()
    print 'done'
